package com.github.cyf.cacheManager;

/**
 * @author chenyifan
 * @create 2025-02-06 9:24
 */
public enum CacheNameEnum {

    SYS_CONFIG("SYS_CONFIG", "系统配置", 1),
    MENU_CACHE("MENU_CACHE", "菜单缓存", 2);

    private String name;
    private String description;

    /**
     * 缓存初始化顺序，级别越低，越早被初始化
     * <p>
     * 如果缓存的加载存在一定的依赖关系，通过缓存级别控制初始化或者刷新时缓存数据的加载顺序<br>
     * 级别越低，越早被初始化<br>
     * <p>
     * 如果缓存的加载没有依赖关系，可以使用默认顺序<code>Ordered.LOWEST_PRECEDENCE</code>
     *
     * @return 初始化顺序
     * @see org.springframework.core.Ordered
     */
    private Integer order;

    CacheNameEnum(String name, String description, Integer order) {
        this.name = name;
        this.description = description;
        this.order = order;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public Integer getOrder() {
        return order;
    }

    @Override
    public String toString() {
        return "CacheTypeEnum{" +
                "name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", order=" + order +
                '}';
    }
}